﻿using System;

namespace TheLogWatcher
{
    public class ColumnOption
    {
        private string title;
        /// <summary>
        ///     The title of a column.
        /// </summary>
        public string Title
        {
            set { this.title = value; }
            get { return this.title; }
        }

        private bool visible;
        /// <summary>
        ///     The visibility status of a column.
        /// </summary>
        public bool Visible
        {
            set { this.visible = value; }
            get { return this.visible; }
        }

        private int width;
        /// <summary>
        ///     The width of a column in pixels.
        ///     "0" means the column is invisible.
        /// </summary>
        public int Width
        {
            set { this.width = value; }
            get { return this.width; }
        }

        /// <summary>
        ///     Gives the width value according to its visibility.
        /// </summary>
        /// <returns>"0" if column is invisible and a real value if it is visible.</returns>
        public int getRealWidth()
        {
            if (this.visible)
            {
                return this.width;
            }
            return 0;
        }
    }
}
